﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Business.Common.Factory;
using Business.Common.Service.Request;
using Business.Common.Service.Response;
using Business.Contract.ServiceContract;
using Business.Core;
using Business.ValueObject;
using Business.ValueObject.Context;
using DataAccess.UnitTransaction.Contract;
using DataAccess.UnitTransaction.Core;
using Microsoft.Practices.Unity;

namespace CacheStatusDetailVehicles.SISCONVE
{
    class Program
    {
        static void Main(string[] args)
        {
            DependencyFactory.Container.RegisterType<IUnitTransaction, UnitTransaction>();

            IFacadeInternalService facadeInternalService = FacadeInternalService.GetInstance;

            Request request = new Request
            {
                ServiceContext = GetContext()
            };

            DateTime tiempo1 = DateTime.Now;
            Response response = facadeInternalService.CacheStatusDetailVehicles(request);

            DateTime tiempo2 = DateTime.Now;
            TimeSpan total = new TimeSpan(tiempo2.Ticks - tiempo1.Ticks);
            System.Console.WriteLine("Tiempo de la consulta: " + total.ToString());

           Console.ReadLine();
        }

        private static VOServiceContext GetContext()
        {
            return new VOServiceContext
            {
                User = new VOUser
                {
                    Id = 1,
                    UserName = "Matias"
                }
            };
        }
    }
}
